beginobjectscript; // basic door

variables;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; // door closed, waiting
	if (my_current_message() == DOOR_OPEN_MESSAGE) {
		pc_heard_sound(134);
		
		// we start anim now. WHich anim depends on which door
		if (object_type(ME) == 50)
			run_object_animation(1,0,35);
		if (object_type(ME) == 52)
			run_object_animation(2,0,35);
		if (object_type(ME) == 54)
			run_object_animation(3,0,35);
		if (object_type(ME) == 56)
			run_object_animation(4,0,35);
		set_state(3);
		}
break;

beginstate 3; // door opening
	if (am_i_doing_action() == FALSE) {
		if (object_type(ME) == 50)
			set_object_icon(ME,2);
		if (object_type(ME) == 52)
			set_object_icon(ME,3);
		if (object_type(ME) == 54)
			set_object_icon(ME,6);
		if (object_type(ME) == 56)
			set_object_icon(ME,7);
		set_object_blockage(ME,0);
		set_state(4);
		}
break;

beginstate 4; // door open
	// nothing more to do
break;
